package com.designpattern.creating.singleton;

/**
 * @Author chengzelee
 * @Date 2022/11/24 18:08
 * @Desc 懒汉单例，线程安全
 */
public class Singleton_lazy_safe {

    private static Singleton_lazy_safe instance;

    public static synchronized Singleton_lazy_safe getInstance() {
        if (instance != null) {
            return instance;
        }
        instance = new Singleton_lazy_safe();
        return instance;
    }
}
